package com.jn.book.views;

import android.content.Intent;

import com.bumptech.glide.Glide;
import com.jn.book.R;
import com.jn.book.base.BaseActivity;
import com.jn.book.databinding.ActivityBookDetailBinding;
import com.jn.book.entity.Books;

public class BookDetailActivity extends BaseActivity<ActivityBookDetailBinding> {

    @Override
    public int getLayoutId() {
        return R.layout.activity_book_detail;
    }

    @Override
    public void init() {
        Intent intent = getIntent();
        Books.ResultDTO.DataDTO book = (Books.ResultDTO.DataDTO) intent.getSerializableExtra("book");
        mBinding.title.setText(book.getTitle());
        mBinding.detail.setText(book.getSub2());
        Glide.with(this).load(book.getImg().replace("http", "https")).into(mBinding.image);
    }
}